<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="vue.js"></script>
</head>
<body>
    <div id="app">
        <input type="text" v-model="msg">
        <h2>msg的原始的内容是：{{msg}}</h2>
        <p>v-text:<span v-text="msg"></span></p> 
        <p>v-big:<span v-text="msg" v-big="msg"></span></p> 
        <input type="button" @click="add" value="点我+1">
        <hr>
        <input type="text" v-fbind:value="mes">
    </div>


    <script type="text/javascript">
        var vm =new Vue({
            el: '#app',
            data: {
                msg:'',
                mes:'1'
            },
            directives:{
                big(element,binding){
			    element.innerText = binding.value * 10
		        },
                fbind:{
                    bind(element,binding) {
                        element.value = binding.value
                    },
                    inserted(element,binding) {
                        element.focus()
                    }
                }
            },
            methods:{
                add(){
                    this.msg++
                }
            }
        });
    </script>
</body>
</html>